<style scoped>
body { background-color: #f3f3f3 }
.header {
  height: 125px;
  background-color: #4dd3b4;
  padding: 20px 0;
  box-sizing: border-box;
}
.user {
  min-width: 65px;
  margin: 0 auto;
  text-align: center;
}
.user img {
  width: 65px;
  height: 65px;
  border-radius: 50%;
}
.user span {
  color: #fff;
  font-size: 14px;
  display: block;
}
.menu-line-box {
  margin-top: 20px;
}
.menu-line {
  display: flex;
  display: -webkit-box;
  display: -webkit-flex;
  -webkit-box-pack: justify;
  justify-content: space-between;
  padding: 10px;
  background-color: #fff;
  border-bottom: 1px solid #eee;
}
.title img {
  width: 20px;
  height: 20px;
  display: inline-block;
}
.title span {
  font-size: 16px;
  vertical-align: top;
  display: inline-block;
  margin-left: 10px;
}
.mark {
  color: #ccc;
  font-size: 14px;
  line-height: 20px;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-position: right;
  padding-right: 30px;
  background-image: url("../../public/images/order.png");
}
ul {
  margin: 0;
  padding: 0;
}
.user-order-type {
  padding: 20px 0;
  background-color: #fff;
  display: flex;
  display: -webkit-box;
  display: -webkit-flex;
}
.type-btn {
  flex: 1;
  -webkit-flex: 1;
  -webkit-box-flex: 1;
  text-align: center;
}
.btn-icon {
  position: relative;
  width: 30px;
  margin: 0 auto;
}
.btn-icon img {
  width: 30px;
  height: 30px;
}
.btn-icon i {
  background-color: #f9ad0b;
  color: #fff;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  line-height: 18px;
  position: absolute;
  right: -10px;
  top: -10px;
  font-size: 10px;
  font-style: normal;
}
.type-btn span {
  display: block;
  font-size: 14px;
  color: #777;
}

.footer {
  display: flex;
  display: -webkit-box;
  display: -webkit-flex;
  position: fixed;
  bottom: 0;
  padding: 5px 0;
  width: 100%;
  background-color: #fff;
}
.base-fixed{
  position: fixed;
  left:0;
  bottom: 0;
  width: 100%;
}
.base-menu {
  flex: 1;
  -webkit-flex: 1;
  -webkit-box-flex: 1;
  text-align: center;
  font-size: 14px;
}
.base-manu .manu::before {
  display: block;
  content: '';
  width: 20px;
  height: 20px;
  background: url('../../public/images/manu.png');
  background-size: 60px 41px;
  margin: 2px auto;
}

.base-menu.active,
.base-menu.active span {
  color: #4dd3b4;
}
.see-goods{
  font-size: 15px;
  color: #6c6c6c;
  margin-top: -2px;
}
.base-header > i {
  position: absolute;
  width: 18px;
  height: 25px;
  top: 12px;
  left: 10px;
  display: inline-block;
  background-image: url('../../public/images/arrow-left.png');
  background-size: 100%;
}
.message_detail{
  flex: 1;
  -webkit-flex: 1;
  -webkit-box-flex: 1;
  font-size: 16px;
  text-align: left;
  color: #333333;
  padding-left: 20px;
}
.list-count{
   height: 60px;
    display: flex;
    display: -webkit-box;
    display: -webkit-flex;
    align-items: center;
  -webkit-align-items: center;
  -webkit-box-align: center;
  -moz-box-align: center;
  background-color: #ffffff;
  border-bottom: 1px solid #eee;
}
</style>

<template>
  <div>
    <div id="aa">
      <div class="header">
        <div class="user" @tap="$router.go('message');">
          <img :src="data.memberInfo.imageUrl" v-if="data.memberInfo.imageUrl">
          <img src="../../public/images/touxiang.png" alt="" v-if="!data.memberInfo.imageUrl">
          <span>{{data.memberInfo.name}}</span>
        </div>
      </div>
      <div class="menu-line" @tap="$router.go({name: 'orderList', query: {orderStatus: -1}});">
        <div class="title">
          <img src="/public/images/order.png">
          <span>我的订单</span>
        </div>
        <div class="see-goods">
          查看全部订单
          <i class="link-icon mui-icon mui-icon-arrowright"></i>
        </div>
      </div>
    </div>
    <div class="user-order-type">
      <div class="type-btn" @tap="$router.go({name: 'orderList', query: {orderStatus: 0}});">
        <div class="btn-icon">
          <img src="/public/images/not.png">
          <i v-if="data.orderCount.payNum>0">{{data.orderCount.payNum}}</i>
        </div>
        <span>待发货</span>
      </div>
      <div class="type-btn" @tap="$router.go({name: 'orderList', query: {orderStatus: 1}});">
        <div class="btn-icon">
          <img src="/public/images/shipments.png">
          <i v-if="data.orderCount.shipNum>0">{{data.orderCount.shipNum}}</i>
        </div>
        <span>已发货</span>
      </div>
      <div class="type-btn" @tap="$router.go({name: 'orderList', query: {orderStatus: 2}});">
        <div class="btn-icon">
          <img src="/public/images/finish.png">
        </div>
        <span>已完成</span>
      </div>
      <div class="type-btn" @tap="$router.go({name: 'orderList', query: {orderStatus: 3}});">
        <div class="btn-icon">
          <img src="/public/images/cancel.png">
        </div>
        <span>已取消</span>
      </div>
    </div>
    <div class="menu-line-box">
      <ul>
        <li class="menu-line" @tap="$router.go('integral');">
          <div class="title">
            <img src="/public/images/jifen.png">
            <span>我的积分</span>
          </div>
          <i class="link-icon mui-icon mui-icon-arrowright"></i>
        </li>
        <li class="menu-line" @tap="$router.go({name: 'address', params: {'id': 0}})">
          <div class="title">
            <img src="/public/images/address1.png">
            <span>地址管理</span>
          </div>
          <i class="link-icon mui-icon mui-icon-arrowright"></i>
        </li>
      </ul>
        <div class="base-fixed">
          <div class="base-manu" style="background-color:#ffffff" ;>
                <a class="manu index-link" href="../../mallHome/index.html">
                    首页
                </a>
            <a class="manu cart-link" href="../../shoppingCart/index.html">
                    购物车
            <b class="shop1" v-if="data.total > 0">{{data.total}}</b>
                </a>
            <a class="manu user-link active">
                    我的
            </a>
            <a href="../../mui/examples/hello-mui/examples/picker.html">测试</a>
          </div>
        </div>
    </div>
  </div>
</template>
<script>
  require('../../public/images/order.png');
  require('../../public/images/not.png');
  require('../../public/images/shipments.png');
  require('../../public/images/finish.png');
  require('../../public/images/cancel.png');
  require('../../public/images/jifen.png');
  require('../../public/images/address1.png');
  require('../../public/images/manu.png');
  require('../../public/images/touxiang.png');
  import store from '../we-store';

  export default {
    data: function () {    // 组件的数据格式
      console.log('1', store);
      return {
        data: store.state
      };
    },
    created: function () {
      // 运行 数据中转站的函数
      store.getOrdersCount();
      store.getCarts();
      store.getMemberInfo();
    },
    watch: {
      $route: function (to) {
        if (this.$route.path === '/we') {
          store.getOrdersCount();
          store.getCarts();
        }
      }
    },
    ready: function () {
      console.log('this.data', this.data);
/*      this.$nextTick(function () {
        mui('.mui-scroll-wrapper').scroll();
        var gallery = mui('.mui-slider');
        gallery.slider({
          interval: 2000
        });
      });*/
    }
  };
</script>

